TK!2
=v
#1
:n
x
:v
.75
:s
i
#2
:n
a
:v
8
:s
i
#3
:n
b
:v
4
:s
i
#4
:n
B
:v
.000757575757575699
:s
o
:c
beta function
#5
:n
IB
:v
.713304519653375
:s
o
:c
incomplete beta function
#7
:n
t
:v
2
:s
i
:c
independent variable    " Student's
#8
:n
n
:v
5
:s
i
:c
degrees of freedom      " distribution
#9
:n
F
:v
.9490302605850691
:s
o
:c
cumulative distr. f-n 
=u
=l
=f
#1
:n
beta
:t
Rule
:a
a,b
:v
z
#2
:n
Ibeta
:c
Incomplete beta function
:t
Rule
:a
x,a,b
:v
z
#3
:n
IbetaCF
:c
Incomplete beta function, CF part
:t
Procedure
:i
x,a,b,n,A2,B2,A3,B3,f,f1
:o
z
#1
:n
beta
:z
z = gamma(a)/gamma(a+b)*gamma(b)

" The beta function is defined as:
"                                   1
"                                  ō
"                                  ³   a-1      b-1         ā(a) ā(b)
"      beta(a,b)  =  beta(b,a)  =  ³  t    (1-t)    dt  =  ÄÄÄÄÄÄÄÄÄÄÄ
"                                  ³                          ā(a+b)
"                                  õ0
/E
E
#2
:n
Ibeta
:z
z = x^a*(1-x)^b*IbetaCF(x,a,b-1,0,1,1,0,1,1,0)/a/beta(a,b)

" The incomplete beta function is defined as:
"                                    x
"                                   ō
"                             1     ³   a-1      b-1 
"        Ibeta(x,a,b)  =  ÄÄÄÄÄÄÄÄÄ ³  t    (1-t)    dt 
"                         beta(a,b) ³
"                                   õ0

" Supporting function: IbetaCF
/E
E
#3
:n
IbetaCF
:z
if abs(f-f1)<1e-12 goto end         " precision check
a1:= a + 1
n1:= n + 1
an1:= a + n1
c:= a*(1+b/an1)/(a+n)*x
d:= n1*b/an1/(a1+n1)*x
A1:= A2 - c*A3
B1:= B2 - c*B3
A:= A1 + d*A2
B:= B1 + d*B2
f:= IbetaCF(x,a+1,b-1,n+1,A,B,A1,B1,A/B,f)  " recursive call
end: z:= f

" Note: This recursive procedure uses the continued fraction representation
"       and recurrence formulas; it is called by 'Ibeta' .
/E
E
=r
#1
:r
"  ***  Beta and incomplete beta function  ***
:s
C
#3
:r
B = beta(a,b)
#4
:r
IB = Ibeta(x,a,b)
#6
:r
F = 1 - .5*Ibeta(n/(n+t^2),n/2,.5)
=p
=t
=n
=g
#1
:c
.000001
:i
10
:v
Yes
:l
60
:f
66
:m
0
:w
80
:b
Yes
:a
Yes
:r
Yes
:h
No
:t
1
:n
Yes
:d
LPT1
%Br,f,0,1,0,1,0
%Ov,f,7,5,0,1,0
